<!DOCTYPE HTML>
<html>
<body>
<script>
console.dir(document);
        var url  = document.URL;
        var doamin  = document.domain;
        var http  = url.indexOf('https://') !== false ? 'https://' : 'http://';
        var url = url.substr( (http + doamin).length - 1);
        console.log(http);
        console.log(url);
</script>
</body>
</html>